\documentclass[a4paper,12pt]{article}

% % % Package import

% % % Hacks

% % % Margin configuration

\addtolength{\textwidth}{150pt}
\addtolength{\evensidemargin}{-75pt}
\addtolength{\oddsidemargin}{-75pt}

% % % New commands

\newcommand{\app}{Foodie}

\newcommand{\qw}[1]{`#1'}
\newcommand{\qqw}[1]{``#1''}

\newcommand{\control}[2]{\qw{#1} #2}

\newcommand{\inlinecode}[1]{\tt#1\normalfont}

% % % New environments

% % % Sectioning configuration

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\begin{document}

\title{\app{} Software Design Document}
\author{Mark LeMoine}
\date{Last updated \today}
\maketitle

\clearpage

\tableofcontents

\section{Introduction}

	\subsection{Scope}
	This software design document provides the design details of \app{}, and is meant to serve as an authoritative reference of \app{}'s specifications. The expected audience is \app{} developers, current and future, and potential investors.

	\subsection{What Is \app{}?}
	\app{} is a general-purpose cookbook-like application for the Apple iPad. It is designed such that adding new recipes is as effortless and intuitive as possible, and provides display/playback of these recipes to chefs working in the kitchen using \app{}. In addition, \app{} contains an integrated social aspect, where one can publicly share recipes with friends or subscribers, with recipes being stored on the cloud.

	\subsection{Purpose}
	The concept of cooking applications on the iPad is not new; the iPad is touted as a tablet for the masses, capable of assisting the consumer with a wide variety of tasks. An e-cookbook application is not out of the ordinary for the iPad. However, current e-cookbook applications \qqw{in the wild} are lacking certain desirable features. Cluttered interfaces, cumbersome addition and editing of recipes, lack of standardization, and limited social aspects are common in the current ecosystem. \app{} aims to solve all of these issues.

	\subsection{Glossary}

		\subsubsection{Definitions}

			\begin{description}
				\item[Recipe] A set of ingredients and steps to produce a food output.

				\item[Step] A single unit of recipe procedure, usually consisting of an action, one or more ingredients, and a vessel.

				\item[Ingredient] A single raw food input to a recipe.

				\item[Vessel] A container used for holding a mixture.

				\item[Mixture] An intermediate combination of one or more input ingredients.

				\item[State] A combination of a mixture and a vessel.

				\item[Implement] A tool used in the prepration of food, typically used to perform actions.

				\item[Action] A procedure done to food as a preparation step.

				\item[Carousel] A UI element used in \app{}, similar to Apple's Cover Flow\texttrademark{}. Carousels in \app{} only show three total images at a time: the main forefront image, and a \qw{forward} and \qw{backward} image. Carousels also include a scrollbar for easy jumping.
			\end{description}

\section{User Interface}

	\subsection{Input Methods}
	Given that \app{} will be created for use on the Apple iPad, user input will be primarily touch-based, with some occasional on-screen keyboard input.

	\subsection{Tabs}
	\app{} will have its functionality logically divided between several tabs. Tabs can be switched to at any time from any other tab.

		\subsubsection{Cookbook Tab}
		Addition, viewing, and playback of recipes.

		\subsubsection{Shopping List Tab}
		Viewing, editing, and exporting of Shopping List.

		\subsubsection{Account Tab}
		\app{} account management, subscriptions, and options for sharing.

		\subsubsection{Browse Recipes Tab}
		Browsing of other users' recipes that have been made public.

	\subsection{Screens}
	Unless otherwise noted, all screens in \app{} have functionally-equivalent portrait and landscape orientations.

		\subsubsection{Loading Screen}
		Shown upon starting up \app{}, and displayed while assets are loaded.

			\paragraph{Controls}
			None

		\subsubsection{Cookbook Screen}
		The first interactive screen shown after \app{} loads.

			\paragraph{Controls}

				\subparagraph{\control{Add New Recipe}{Button}}
				Activates the Recipe Staging screen.

				\subparagraph{\control{Cookbook Display}{Carousel}}
				Displays the current set of recipes as images and a short label description. Tapping on the forefront recipe image loads the Recipe Display screen with that recipe.

				\subparagraph{\control{Recipe Filter}{Button}}
				Activates the Recipe Filter Screen.

		\subsubsection{Recipe Filter Screen}
		Displays filters and their statuses, and enables users to edit filters.

			\paragraph{Controls}

				\subparagraph{\control{Recipe Filter}{Table View}}
				Displays available filters

\section{Requirements}

\section{Use Cases}

\section{Behavior}

	\subsection{Controls}

		\subsubsection{Recipe Filters}
		Filters are to be configurable if user configuration makes logical sense for that type of filter. Configuration will typically take the form of a widget requesting user input, and will be shown on two occasions:
		\begin{enumerate}
			\item Upon adding the filter to the sink for the first time.
			\item Tapping the filter in the sink.
		\end{enumerate}

		If the configuration input to the widget is invalid in either case, the confirm button of the widget will be greyed out. For example, if a filter has a text input widget and requires a non-empty string, the \qw{OK} button will be grayed out if the current input string is empty.
		
		If the widget is dismissed in the first case, the filter is to be removed from the sink. If dismissed in the second case, no changes are to be made to the configuration of that filter, but the filter will remain in the sink.

		This behavior ensures that filters are configured \qqw{properly} (i.e. logically correct) before being accepted into the sink.

			\paragraph{Title Text Filter}
			Used to filter recipes using recipe title text. If any substring of the recipe title is a case-insensitive match to the stored search string, the recipe will pass the filter. Configuration consists of a text input dialog, with \qw{OK} and \qw{Cancel} buttons. Valid input is any string consisting of at least one printable character.

			\paragraph{Time Filter}
			Filters recipes based on prep time needed. Configuration is done via picker, with user-selected parameters in criteria (prep time, cook time, total time), function (at least, more than, at most, less than), units (minutes, hours, days), and time amount (5-180:5, 1-72:1, 1-7:1). Any input is valid.

			\paragraph{Ingredient Filter}
			Filters recipes based on input ingredients. Configuration is done via ingredient selector. Any valid ingredient selector output is valid.

			\paragraph{Implement Filter}
			Filters recipes based on implements used. Configuration is done via implement selector. Any valid implement selector output is valid.

			\paragraph{Favorites Filter}
			Passes recipes that are marked as favorites.

			\paragraph{Bookmark Filter}
			Passes recipes that are marked as a bookmarked recipe.

			\paragraph{Tag Filter}
			Passes recipes that have specific tags.

\end{document}
